﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PServiceBus.Core.Runtime {
    public static class ServiceLocator<T> where T : class {

        private static Dictionary<Type, object> _types = new Dictionary<Type, object>();
     
        public static T Get()  {
            return _types.ContainsKey(typeof(T)) ? _types[typeof(T)] as T : default(T);
        }

        public static void Set(T value) {
            _types[typeof(T)] = value;
        }

    }
}
